<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>收款 </title>
    <base target="_self" />
    <link href="../Styles/css.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/ts_css.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="../Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
    $.ajax({  
        type: "post",  
        url: "${ctx}/shop/area/getProvince",  
        success: function (data) {  
            for (var i = 0; i < data.length; i++) {  
                $('#province_code').append("<option value='" + data[i].id + "' >" + data[i].aName + "</option>");  
            }  
        },  
        error: function () {  
            alert("加载省失败");  
        }  
    });  
}); 

</script>
<script type="text/javascript">  
    /*加载省下拉选*/  
    $(function () {  
        $.ajax({  
            type: "post", 
			dataType:"json",
            url: "/wanda/sale_chance/selectProjectAll.do",  
            success: function (data) {  
            	$('#projectName').empty();
				 $("#projectName").append("<option value=''>----选择楼栋----</option>");
			         $.each(data.tasks,function(index,item){
				         $("#projectName").append( "<option value='"+item.projectId+"'>"+item.projectName+"</option>");
	            });
            }, 
        });  
   
    
        $('#projectName').change(function(){
    		var projectId = $('#projectName').val();
    		$.ajax({
    			url:"/wanda/sale_chance/selectBuild.do",
    			type:"post",
    			dataType:"json",
    			data:{"projectId":projectId},
    			success:function(data){
    				$('#buildName').empty();
    				 $("#buildName").append("<option value=''>----选择单元----</option>");
    				   $.each(data.tasks,function(index,item){
    					 $("#buildName").append( "<option value='"+item.buildId+"' >"+item.buildName+"</option>");
    		            });
    			}
    		});
    		
    		$('#buildName').change(function(){
        		var buildId = $('#buildName').val();
        		$.ajax({
        			url:"/wanda/sale_chance/selectUnit.do",
        			type:"post",
        			dataType:"json",
        			data:{"buildId":buildId},
        			success:function(data){
        				$('#unitCode').empty();
        				 $("#unitCode").append("<option value=''>----选择单元----</option>");
        				   $.each(data.tasks,function(index,item){
        					  // alert(item.unitName);
        					 $("#unitCode").append( "<option value='"+item.unitId+"'>"+item.unitName+"</option>");
        		        });
        			}
        		});
        	
        		$('#unitCode').change(function(){
            		var unitId = $('#unitCode').val();
            		
            		
            		$.ajax({
            			url:"/wanda/sale_chance/room.do",
            			type:"post",
            			dataType:"json",
            			data:{"unitId":unitId},
            			success:function(data){
            			
            				$('#roomCode').empty();
            				 $("#roomCode").append("<option value=''>----选择单元----</option>");
            				   $.each(data.tasks,function(index,item){
            					 $("#roomCode").append( "<option value='"+item.roomId+"'>"+item.roomName+"</option>");
            		            });
            			}
            		});
            	});	
    		}); 
    	}); 
    }); 
   
</script > 

</head>
<body>
    <form action="/wanda/sale_chance/insert.do?projectId=${projectId}&roomId=${roomId}&buildId=${buildId}&unitId=${unitId}&" method="post">

    <div style="background: #EFF3FF; width: 22%; float: left; overflow-y: auto;">
        <div id="tree" class="tree" style="background: #EFF3FF;">
        </div>
    </div>
    <div style="width: 75%; float: left; border: 0px solid #82AFE8">
        <table width="100%">
            <tr>
                <td width="6%">
                   收取金额：
                </td>
                <td width="13%">
                <input name="money" type="text" id="money" style="width:95%;" />
                </td>
           </tr>     
            
            <tr align="center">
               <td width="5%" colspan="6">
                   <a  href="javascript:void(0)" onclick="updateMoney('${roomPayId}')">提交</a>
               </td>
            </tr>
        </table>
        
        <script>
			function updateMoney(roomPayId) {
				
				alert("收款成功！！！");
				
				var Money = document.getElementById("money").value;
				//alert(Money);
				location.href = "/wanda/roompay/updateMoney.do?Money="
							+ Money+"&roomPayId="+roomPayId;
				 
			}
		</script>
</form>
</body>
</html>
